import java.util.Arrays;
import java.util.Scanner;

public class p1 {
    public static void main(String[] args) {
        Arrays.sort();
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-- > 0){
            int a = sc.nextInt();
            int b = sc.nextInt();
            int ans = 0;
            if(a > b){
                ans = a % b == 0 ? 1 : 2;
            }else{
                ans = b % a == 0 ? b / a : b / a + 1;
            }
            System.out.println(ans);
        }
    }
}
